package com.tucanstubs.android_wheresmystuff.items;

import java.util.Date;

/**
 * Subclass of item, represents a lost item
 * @author team 37
 * @version 1.0 02/25/2013
 */
public class LostItem extends Item{
	private double reward;
	private ItemType type;
	
	/**
	 * Creates a new lost item with inputed info
	 * @param name item name
	 * @param description item description
	 * @param location item location
	 * @param dateEntered date item was created
	 * @param reward reward for the item
	 * @param type item type
	 * @param id unique item id
	 */
	public LostItem(String name, String description, double[] location, Date dateEntered,
			double reward, ItemType type,int id) {
		super(name, description, location, dateEntered,id);
		this.reward=reward;
		this.type=type;
	}
	/**
	 * returns a string representation of the item
	 * @return string representation of the item
	 */
	public String toString(){
		return "Lost Item:"+super.toString();
	}
	/**
	 * Getter for reward
	 * @return the items reward
	 */
	public double getReward(){
		return reward;
	}
	/**
	 * Getter for item type
	 * @return the item's item type
	 */
	public ItemType getItemType(){
		return this.type;
	}
	
	/**
	 * Overrides the equals method
	 * @param Object obj the object to compare with
	 * @return a boolean for whether the item is equal to the given item
	 */
	@Override
	public boolean equals(Object obj){
	    if (!(obj instanceof LostItem))return false;
	    LostItem lostObj= (LostItem)obj;
	    return ((this.getItemType().equals(lostObj.getItemType()))&&
	    		(this.getReward()==lostObj.getReward())&&
	    		 super.equals(obj));
	}
}
